********************************************************************************************
**** DESCRIPTIVE STATISTICS OF HOUSEHOLD CHARACTERISTICS AT BASELINE AND FOLLOW-UP
**** ESTIMATION AT DIFFERENT TERCILES OF EXPENDITURE DISTRIBUTION
**** This file generates output tables for group comparison at baseline using quantile 
**** regression.
**** Version: 21/05/2014
********************************************************************************************

	* EXPENDITURE

		xtile group = ln_expenditure if round == 2010, nq(3)
		xtile temp = ln_expenditure if round == 2012, nq(3)
		replace group = temp if round == 2012
		drop temp
		
	 	exptreattest sh_food sh_clothing sh_school sh_health sh_utilities sh_home

				esttab using "Outputs/Expenditure treatment differences at different expenditure terciles.tex", f replace compress noobs nonumb nomtitles width(0.8\textwidth) gaps ///
				cells( ///
				"c_1(fmt(3) star pvalue(t_1)) c_2(fmt(3) star pvalue(t_2)) c_3(fmt(3) star pvalue(t_3)) cf_1(fmt(3) star pvalue(tf_1)) cf_2(fmt(3) star pvalue(tf_2)) cf_3(fmt(3) star pvalue(tf_3))" ///
				"se_1(fmt(3) par) se_2(fmt(3) par) se_3(fmt(3) par) sef_1(fmt(3) par) sef_2(fmt(3) par) sef_3(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N2 N3 N4 N5 N6, layout("@ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{3}{c}{\textit{Baseline}} & \multicolumn{3}{c}{\textit{Follow-up}}", span) ///
				collabels("1" "2" "3" "1" "2" "3") ///
				ti("Difference in expenditure and expenditure budget shares by treatment status at different quantiles (baseline)\label{QExpAllBaseline}")
	 
	 	drop group
	 
	* CONSUMPTION

		xtile group = ln_expenditure_adj if round == 2010, nq(3)
		xtile temp  = ln_expenditure_adj if round == 2012, nq(3)
		replace group = temp if round == 2012
		drop temp

		exptreattest sh_food_adj sh_clothing_adj sh_school_adj sh_health_adj sh_utilities_adj sh_home_adj

				esttab using "Outputs/Consumption treatment differences at different expenditure terciles.tex", f replace compress noobs nonumb nomtitles width(0.8\textwidth) gaps ///
				cells( ///
				"c_1(fmt(3) star pvalue(t_1)) c_2(fmt(3) star pvalue(t_2)) c_3(fmt(3) star pvalue(t_3)) cf_1(fmt(3) star pvalue(tf_1)) cf_2(fmt(3) star pvalue(tf_2)) cf_3(fmt(3) star pvalue(tf_3))" ///
				"se_1(fmt(3) par) se_2(fmt(3) par) se_3(fmt(3) par) sef_1(fmt(3) par) sef_2(fmt(3) par) sef_3(fmt(3) par)") label star(* 0.1 ** 0.05 *** 0.01) ///
				stats(N1 N2 N3 N4 N5 N6, layout("@ @ @ @ @ @") labels("Observations") fmt(0)) ///
				mgroups("\multicolumn{3}{c}{\textit{Baseline}} & \multicolumn{3}{c}{\textit{Follow-up}}", span) ///
				collabels("1" "2" "3" "1" "2" "3") ///
				ti("Difference in expenditure and expenditure budget shares by treatment status at different quantiles (baseline)\label{QExpAllBaseline}")
						
		drop group
